package com.xucy.springboot.redis;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author xucy
 * @Date 2019-07-04 13:42
 * @Description
 **/
@RestController
@RequestMapping("/redisSessionCon")
public class RedisSessionController {

    @RequestMapping("/getSession")
    public Map getSession(HttpServletRequest request){

        Map map =new HashMap(2);
        map.put("sessionId",request.getSession().getId());
        map.put("key","my name is xu");


        return map;
    }
}
